package com.t2t.top.consumer;

/**
 * Created by Administrator on 2017/6/6.
 */

import com.t2t.top.api.DemoApi;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Consumer {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring/spring-consumer.xml"});
        context.start();

        DemoApi demoApi = (DemoApi) context.getBean("demoApi"); // 获取远程服务代理
        String hello = demoApi.sayHello("yangpengfei"); // 执行远程方法

        System.out.println(hello); // 显示调用结果
    }

}